package com.cowin.sys.controller;
import com.cowin.base.result.Result;
import com.cowin.base.result.ResultGenerator;
import com.cowin.base.BaseController;
import com.cowin.sys.model.TcSysCodeList;
import com.cowin.sys.model.vo.SysCodeVo;
import com.cowin.sys.service.TcSysCodeListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import java.util.List;

/**
 * Created by  on 2020/01/07.
 * @author CodeGenerator
 */
@Slf4j
@RestController
@RequestMapping("/tc/sys/code/list")
@Api(value = "TcSysCodeListController", description = "通用代码值控制器", tags = "TcSysCodeListController", consumes = "application/json")
public class TcSysCodeListController extends BaseController<TcSysCodeList> {
    @Resource
    private TcSysCodeListService tcSysCodeListService;

    @GetMapping("/type/{codeType}")
    @ApiOperation(value = "系统配置参数查询")
    public Result getCodeNameAndValueByType(@PathVariable String codeType){
        List<SysCodeVo> list =tcSysCodeListService.findCodeNameAndValueByType(codeType);
        return ResultGenerator.genSuccessResult(list);
    }

}
